<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			const setting = uni.getStorageSync("setting_data_key")
			if (setting) {
				this.globalData.settingData = setting
				console.log("using storage setting data")
			}
			const table = uni.getStorageSync("table_data_key")
			if (table) {
				this.globalData.tableData = table
				console.log("using storage table data")
			}
			const score = uni.getStorageSync("score_data_key")
			console.log(score)
			if (score) {
				this.globalData.scoreData = score
				console.log("using storage score data")
			}
		},
		onShow: function() {
			console.log('App Show')
			console.log("===globalData===")
			console.log(this.globalData)
			console.log("===globalData===")
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData: {
			appConfig: {
				"host": "https://mdreamfever.com:9008",
			},
			settingData: {
				scoreQueryEntry: "default",
				scoreQueryMode: "ALL",
				scoreQuerySemester: "全部",
				beginTime: new Date().getTime(),
				username: "",
				password: "",
				currentSemester: "",
				scoreQuerySemester: "",
			},
			tableData: {
				name: "",
				number: "",
				courses: [],
				remark: "",
				years: [],
			},
			scoreData: {
				scores: [],
			},
		},
	}
</script>

<style>
	.message {
		text-align: center;
		padding: 20rpx;
		font-size: .8em;
		color: #ff0000;
		background-color: #ffffff;
	}

	.copy-right {
		position: fixed;
		bottom: 0;
		font-size: .8em;
		margin: 40rpx;
		text-align: center;
	}
</style>
